# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Benjamin Andresen <bandresen gmail com>

pkgname=namazu
pkgver=2.0.21
pkgrel=5
pkgdesc="Namazu is a full-text search engine intended for easy use."
url="http://namazu.org/"
license=('GPL')
arch=('loong64' 'x86_64')
depends=(perl-file-mmagic)
validpgpkeys=('474E4D938E9711F6662D8A4217F552F410E7D14E')
source=(http://namazu.org/stable/$pkgname-$pkgver.tar.gz{,.sig})
sha512sums=('c0ce1b8c8b8ce30ee7d28cfed790a9c8585d1b468eefe2ba4ac70976e09329ae04a3a3bbf0b86b9673cfdf206f2b103896daca2f053062f451884fa659b31ea6'
            'SKIP')

build() {
  cd "$srcdir"/$pkgname-$pkgver
  ./configure \
  	--prefix=/usr \
	--sysconfdir=/etc \
	--localstatedir=/var/lib \
	--mandir=/usr/share/man \
	--libexecdir=/usr/lib/namazu \
	--libdir=/usr/lib/namazu
  # Make the address reproducible, the address shouldn't be our build host
  # anyway but changed by the user.
  sed -i 's/\$ADDRESS = .*/\$ADDRESS = "changeme@example.com";/' pl/conf.pl
  make
}

package() {
  cd "$srcdir"/$pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}
